package hotel.common;

import org.nutz.dao.util.DaoUp;
import com.alibaba.druid.pool.DruidDataSource;

public class DaoConfig {
	
	public static void load() {
		// Druid配置 数据库连接池 
		DruidDataSource ds = new DruidDataSource();
		ds.setDriverClassName("com.mysql.cj.jdbc.Driver");
		ds.setUrl("jdbc:mysql://localhost:3306/hotel?serverTimezone=UTC&characterEncoding=utf8&useSSL=false");
		ds.setUsername("root");
		ds.setPassword("12345678");
		ds.setMaxWait(15000);
		ds.setDefaultAutoCommit(false);
		ds.setConnectionProperties("config.decrypt=false");
		
		// 配置DaoUp类
		DaoUp.me().setDataSource(ds);
		
		
	}
	
	public static void close() {
		DaoUp.me().close();
	}
}
